<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../common/header.jsp"%>

<h1>Questionnaire management
    <a href="/questionnaire" type="button" class="btn btn-default btn-sm">Home</a>
    <div class="log-icon icon-right"></div>
</h1>
<hr/>

<h3>All Question List
    <a href="/questionnaire/question/addItem" type="button" class="btn btn-default btn-sm">Add</a>
    <a href="/questionnaire/question/list/2" type="button" class="btn btn-default btn-sm">Preview</a>
</h3>

<!-- 如果列表非空 -->
<c:if test="${!empty list}">
    <table class="table table-bordered table-striped">
        <tr>
            <th>ID</th>
            <th>Content</th>
            <th>Type</th>
            <th>Impact</th>
            <%--<th>Choose1</th>--%>
            <%--<th>Choose2</th>--%>
            <%--<th>Choose3</th>--%>
            <%--<th>Choose4</th>--%>
            <%--<th>Choose5</th>--%>
            <%--<th>Survey</th>--%>
            <%--<th>Score</th>--%>

            <%--<th>Note</th>--%>
            <th>Operation</th>
        </tr>

        <c:forEach items="${list}" var="item">
            <tr>
                <td>${item.id}</td>
                <td>${item.content} </td>
                <td>${item.type} </td>
                <td>${item.impact} </td>
                <%--<td>${item.choose1} </td>--%>
                <%--<td>${item.choose2} </td>--%>
                <%--<td>${item.choose3} </td>--%>
                <%--<td>${item.choose4} </td>--%>
                <%--<td>${item.choose5} </td>--%>
                <%--<td>${item.survey} </td>--%>
                <%--<td>${item.score} </td>--%>
                <%--<td>${item.note} </td>--%>

                <td>
                        <%--<a href="/questionnaire/question/showItem/${item.id}" type="button" class="btn btn-sm btn-success">details</a>--%>
                    <a href="/questionnaire/question/updateItem/${item.id}" type="button" class="btn btn-sm btn-warning">update</a>
                    <a href="/questionnaire/question/deleteItem/${item.id}" type="button" class="btn btn-sm btn-danger">delete</a>

                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>

<%@ include file="../common/footer.jsp"%>